﻿using System;
using System.Windows;
using System.Windows.Threading;
using Microsoft.Phone.Controls;
using Microsoft.Phone.Shell;

namespace PokerFunUtilities
{
    public partial class PokerClock : PhoneApplicationPage
    {
        private int countdownSeconds = 01;
        private int countdownMinutes = 20;
        DispatcherTimer tmr = new DispatcherTimer();
        ApplicationBar ApplicationBar = new ApplicationBar();

        public PokerClock()
        {
            InitializeComponent();
        }

        public void OnTimerTick(object sender, EventArgs args)
        {
            countdownSeconds += -1;
            if (countdownSeconds == 0)
            {
                countdownSeconds = 60;
                countdownMinutes += -1;
            }
            tglTime.Text = countdownMinutes.ToString() + " : " + countdownSeconds.ToString();

        }


        private void btnStart_Click(object sender, RoutedEventArgs e)
        {
            
            tmr.Interval = TimeSpan.FromSeconds(1);
            tmr.Tick += OnTimerTick;
            tmr.Start();

        }




  
    }
}